﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Twi.Pages.SCS.Model;

namespace Twi.Pages.SCS.BLL
{
    public class _Option
    {
        private static readonly _Option _instance = new _Option();
        private _Option() { }
        public static _Option Instance
        {
            get { return _instance; }
        }

        /// <summary>
        /// 根据选项类别获取选项
        /// </summary>
        /// <param name="optionTypeID"></param>
        /// <returns></returns>
        public List<TOption> GetByOptionTypeID(string optionTypeID)
        {
            using (ScsDataClassesDataContext db = new ScsDataClassesDataContext(ScsConntions.TyScsConnectionString))
            {
                var q = from p in db.TOption
                        where p.FOptionTypeID.Equals(optionTypeID)
                        orderby p.FSort
                        select p;
                return q.ToList();
            }
        }
    }
}
